package com.atcumt.bytedance;

import java.util.Arrays;
import java.util.Scanner;

public class BT03 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        scanner.nextLine();
        char[][] grid = new char[m][n];
        for (int i = 0; i < m; i++) {
            String s = scanner.nextLine();
            for (int j = 0; j < n; j++) {
                String[] s1 = s.split(" ");
                grid[i][j] = s1[j].charAt(0);
            }
        }

        System.out.println(Arrays.toString(grid[0]));

    }
}
